class Solution:
    def isPowerOfThree(self, n: int) -> bool:
        pass


if __name__ == "__main__":
    print(Solution().isPowerOfThree(27))  # True
    print(Solution().isPowerOfThree(0))  # False
    print(Solution().isPowerOfThree(9))  # True
    print(Solution().isPowerOfThree(45))  # False

